<?php

class GDGE_Auth_Result
{
	const SUCCESS = 1;
	const FAILURE = 0;
    const FAILURE_CREDENTIAL_INVALID = -1;
	const FAILURE_USER_BANNED = -2;
	
	private $_code;
	private $_identity;
	private $_message;
	
	public function __construct($code, $identity, $message=null)
	{
		$this->_code = $code;
		$this->_identity = $identity;
		$this->_message = $message;
	}
	
	public function getCode() {
		return $this->_code;
	}
	
	public function isValid() {
		return $this->_code == self::SUCCESS;
	}
	
	public function getIdentity() {
		return $this->_identity;
	}
}